<template>
    <div class="route-container">
        <div class="route-list-box">
            <div class="route-list">
                <div class="back">
                    <van-icon name="arrow-left" size="26" color="#333"></van-icon>
                </div>
                <div class="routes">
                    <div class="steps">
                        <van-steps direction="vertical" :active="0">
                            <van-step>
                                <span>我的位置</span>
                            </van-step>
                            <van-step>
                                <span>{{ targetName }}</span>
                            </van-step>
                        </van-steps>
                    </div>
                    <div class="btn-con">
                        <van-icon name="plus"></van-icon>
                        <van-icon name="exchange"></van-icon>
                        <i class="iconfont icon-mic-on"></i>
                    </div>
                </div>
            </div>
            <div class="route-type-list">
                <div class="typelist">
                    <input hidden type="radio" name="type" id="moto">
                    <label for="moto">
                        <div class="item-bg"></div>
                        <div class="cont">
                            <i class="iconfont icon-moto"></i>
                            <span>摩托车</span>
                        </div>
                    </label>
                    <input hidden type="radio" name="type" id="car">
                    <label for="car">驾车</label>
                    <input hidden type="radio" name="type" id="train">
                    <label for="train">火车</label>
                    <input hidden type="radio" name="type" id="fly">
                    <label for="fly">飞机</label>
                    <input hidden type="radio" name="type" id="ride">
                    <label for="ride">骑行</label>
                    <input hidden type="radio" name="type" id="taxi">
                    <label for="taxi">打车</label>
                </div>
                <div class="unfold">
                    <van-icon name="arrow-down" size="14" color="#333"></van-icon>
                </div>
            </div>
        </div>
        <FloatingBox></FloatingBox>
    </div>
</template>

<script setup lang='ts'>
import FloatingBox from '@/components/FloatingBox.vue';
import { ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'

const $router = useRouter();
const $route = useRoute();

const { lng: targetLng, lat: targetLat, name: targetName, id: targetPolId } = $route.params;

</script>
<style scoped lang="scss">
.route-container {
    pointer-events: none;
    background: transparent;
}

.route-list-box {
    pointer-events: auto;
    background: #fff;
    margin: 16px 16px;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 0 2px #ddd;
    padding: 20px 10px;

    .route-list {
        display: flex;
        color: #333;
        font-size: 18px;

        input {
            background: transparent;
            border: none;
        }

        .back {
            flex-shrink: 0;
            margin-right: 20px;
        }

        .routes {
            flex-grow: 1;
            background: #ddd;
            display: flex;
            border-radius: 10px;
            align-items: center;
            padding-right: 20px;
            .steps {
                flex-grow: 1;
                color: #333;
                .van-steps {
                    background-color: transparent;
                }
            }
            .btn-con {
                flex-shrink: 0;
                margin-left: 40px;
                i {
                    font-size: 36px;
                    font-weight: bold;
                    margin-left: 20px;
                    &.van-icon-exchange {
                        transform: rotate(-90deg)
                    }
                }
            }
        }
    }
}
.route-type-list {
    width: 100%;
    white-space: nowrap;
    position: relative;
    font-size: 28px;
    color: #333;
    margin-top: 10px;
    .typelist {
        overflow: auto;
        label {
            position: relative;
            display: inline-block;
            margin-right: 20px;
            height: 40px;
            line-height: 40px;
            .item-bg {
                width: 0px;
                height: 100%;
                border-radius: 20px;
                transition: all 0.2s linear;
                background: #333;
            }
            .cont {
                position: absolute;
                top: 50%;
                transform: translateY(-50%);
                
                width: 100%;
                text-align: center;
            }
            span {
                position: relative;
                z-index: 2;
            }
        }
        input[type=radio]:checked + label {
            /* background: red; */
            color: #fff;
            font-weight: bold;
            .item-bg {
                width: 100px;
                padding: 0 20px;
            }

        }
    }
    .unfold {
        position: absolute;
        right: 0px;
        bottom: 0px;
        background: #fff;
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0 10px;
        box-shadow: -5px 0px 10px #ddd;
    }
}
</style>